___________________ Version 1.0, Effector Set I (v1.0)
___________________ Media Lab Xtras
___________________ copyright 1997, As Is Software, Inc.
Effect Symbol: #rotate
_Properties______________Type______Value___
#animMode symbol #static, #range, #infinite, #pendulum, #relativeToPoint
#numFrames integer 1+
#framesPerRevolution integer 0 not allowed, negative means rotate counterclockwise, #infinite only
#interpolation integer 0, 1, 2
#degrees integer positive values are clockwise
#radians integer positive values are clockwise
#startDegrees integer
#startRadians integer
#endDegrees integer
#endRadians integer
#deltaDegrees integer positive values are clockwise
#deltaRadians integer positive values are clockwise
#flip integer true or false
#relativeTo point stage coordinates, valid in RelToPoint mode only
#relativeToX integer
#relativeToY integer
#offsetAngle integer valid in RelToPoint mode only
#offsetAngleRad integer
#easeIn integer frames
#easeOut integer frames
Parameters by Mode
All Modes:
interpolation
flip
Static:
degrees
radians
endDegrees
endRadians
deltaDegrees
deltaRadians
Range:
numFrames
degrees
radians
endDegrees
endRadians
deltaDegrees
deltaRadians
startDegrees
startRadians
easeIn
easeOut
In #range mode the sprite will rotate to the endPosition from itÆs current (or start) position. If the endPosition is a number greater than its starting position then the sprite will rotate clockwise. If it is less than the starting position then it will rotate counter-clockwise. No abbreviating occurs, so if the sprite is at 0 degrees and it is given an endPosition of 720 degrees then it will rotate three times clockwise. ItÆs new starting position will be 720 degrees for the next call to range.
Pendulum:
numFrames
degrees
radians
endDegrees
endRadians
deltaDegrees
deltaRadians
startDegrees
startRadians
easeIn
easeOut
Infinite:
framesPerRevolution
startDegrees
startRadians
easeIn
In #infinite mode the sprite will simply rotate forever. A positive value for æframesPerRevolutionÆ will cause it to rotate clockwise, a negative value will cause it to rotate æcounter-clockwiseÆ.
RelativeToPoint:
relativeTo
relativeToX
relativeToY
offsetAngle
offsetAngleRad
This is a custom mode for the rotate effect only. In this mode, the sprite will always æfaceÆ the point at relativeToPoint, no matter where the sprite is on-screen. If desired, an offsetAngle argument can be provided.
Calling this function will make the sprite treat all subsequent function calls as if their degree arguments are in radians rather than degrees. Call this function with a æfalseÆ argument to reset the sprite to regular degree usage.
Flip
Flip(sprite x, #rotate)
Flip(sprite x, #rotate, flipFlag)
If this function is called without the flipFlag argument, then the sprite will have itÆs flip state toggled. When the flipFlag argument is used, then the sprite will have its flip state set.
GetAngle
GetAngle(sprite x, #rotate)
This argument will return the current angle of the sprite.
GetVector
GetVector(sprite x, #rotate, distance)
GetVector(sprite x, #rotate, distance, degrees)
This function converts a distance and an angle into the sub vectors X and Y. This function returns a point with the X and Y vectors in the x and y positions. If no angle is provided, the current angle of the sprite is used.
GetRotatedRect
GetRotatedRect(sprite x, #rotate)
GetRotatedRect(sprite x, #rotate, degrees)
GetRotatedRect(sprite x, #rotate, degrees, rect)
This function takes a rect and an angle and calculates the new containing rect. If no angle is provided it uses the sprites current angle, and if no rect is provided it uses the rect of the castmember at the spriteÆs location.
IsPointInRotatedRect
IsPointInRotatedRect(sprite x, #rotate, point)
IsPointInRotatedRect(sprite x, #rotate, point, degrees)
IsPointInRotatedRect(sprite x, #rotate, point, degrees, rect)
This function returns true or false if a point is in the rotated rectangle of the sprite. The current rectangle and angle of the sprite are used as defaults, but if desired the user can pass in custom arguments.